import axios from 'axios'

//检验手机号是否注册
export const reqPhoneExist = (phone) => {
  return axios({
    method: 'POST',
    url: '/api/regist/verify_phone',
    data: {
      phone,
    },
  })
}

//接收手机验证码
export const reqPhoneCode = (phone) => {
  return axios({
    method: 'POST',
    url: '/api/login/digits',
    data: {
      phone,
    },
  })
}

//检验手机验证码是否正确
export const reqVerifyCode = (phone, code) => {
  return axios({
    method: 'POST',
    url: '/api/regist/verify_code',
    data: {
      phone,
      code,
    },
  })
}

//注册
export const reqRegister = (phone, password) => {
  return axios({
    method: 'POST',
    url: '/api/regist/user',
    data: {
      phone,
      password,
    },
  })
}
